home *** CD-ROM | disk | FTP | other *** search
/ CyberMycha 2008 January / Cybermycha 1_2008.iso / Data.cab / _DD337BDF083B4A2191A279DE27C5086D < prev    next >
Encoding:
Text File  |  2004-04-29  |  1.0 KB  |  60 lines

  1.  
  2. regc(2, "COMBINED_XFORM")
  3.  
  4. regc(12, "FOG_PARAMS")
  5.  
  6. regcn(14, "DIRECTIONAL_DIR_MS", 0)
  7.  
  8. regc(20, "TEXTURE2_XFORM")
  9.  
  10. // ------------ c40 - c60 reserved
  11. !include("vs_spot_consts.inc")
  12.  
  13. vshader("
  14.  
  15. #define point        v0
  16. #define normal        v1
  17. #define tcoord        v3
  18.  
  19. #define fogp    c12
  20. #define ldir    c14
  21.  
  22.     vs_1_1
  23.  
  24. #include    <cardef.h>
  25. #include    <fog.inc>
  26.  
  27.     def c0, 0, 0, 0, 0
  28.  
  29.     dcl_position    point
  30.     dcl_normal    normal
  31.     dcl_texcoord    tcoord
  32.  
  33.     ; output position
  34.     m4x4    oPos, point, c2
  35.  
  36.     dp3        r4.x, normal, ldir        ; diffuse N*L
  37.  
  38.     ; output diffuse
  39.     mov        oD0.w, r4.x   //  sun
  40. ;------------------------------------------
  41. // spot lights
  42. // used r0 - r2
  43. #if VS_SPOTLIGHTS
  44. #include <vs_spot_func.inc>
  45. #endif
  46. ;----------------------------
  47.     ; output texcoords
  48.     mov        oT0, tcoord           // color
  49.     mov     oT1, tcoord        // dirt
  50.  
  51.     ; terrain lightmap texgen (from model space)
  52.     dp4        oT2.x, point, c20
  53.     dp4        oT2.y, point, c21
  54.  
  55.     ; calc fog
  56.        dp4    r0.x, point, c4
  57.        FOG(r0.x, fogp, r10)
  58. ")
  59.  
  60.